import http from "@/utils/http"

export default {
    role: {
        queryData: "GET:/rider",
        queryDataByID: "GET:/rider/:id",
        putValid: "PUT:/rider/:id",
    },
    queryData(params) {
        return http.get('/rider', params);
    },

    putValid(id, params = {}) {


        let uri = '/rider/' + id;

        return http.put(uri, params);
    },

    queryDataByID(id) {
        console.log("begin query", id)
        let rider_uri = '/rider/' + id.toString();

        return http.get(rider_uri);
    },

    isValidToStr(isValid = 0) {
        let ValidStr = "";
        switch (isValid) {
            case 0:
                ValidStr = "待审核";
                break;
            case 1:
                ValidStr = "通过";
                break;
            default:
                ValidStr = "不通过";
                break;
        }
        return ValidStr;
    },

    statusToStr(status) {
        let statusStr = "";

        switch (status) {
            case -1:
                statusStr = "冻结";
                break;
            case 1:
                statusStr = "可接单";
                break;
            default:
                statusStr = "不可接单";
                break;
        }
        return statusStr;
    },
}